package com.phiture.erp.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author YH
 * @date 2025/4/2
 */

@Getter
@AllArgsConstructor
public enum ErpCommonStatusEnum {
    OPEN(0, "开启"),
    CLOSE(1, "关闭"),
;
    private final Integer status;
    private final String desc;

    public static boolean isOpen(Integer status){
        return Objects.equals(OPEN.status, status);
    }

    public static boolean isClose(Integer status){
        return !isOpen(status);
    }

    public static Integer convertStatus(Integer status){
        return isOpen(status) ? CLOSE.status : OPEN.status;
    }
}
